<script language="javascript" type="text/javascript"
	src="<?php echo $this->load->config->item('base_url') . $this->load->config->item('inc_folder'); ?>scripts/jquery-2.0.3.js"></script>
<script type="text/javascript">
	$(function() {  
        $('#tglawal').datepicker({
			dateFormat:'yy-mm-dd',
			buttonImage:'assets/images/calendar.gif',
			buttonImageOnly : true,
			showOn : 'button'
		});  
    });  
	
	$(function() {  
        $('#tglakhir').datepicker({
			dateFormat:'yy-mm-dd',
			buttonImage:'assets/images/calendar.gif',
			buttonImageOnly : true,
			showOn : 'button'
		});  
    });  
</script>
<h1><?php //echo $nama_perusahaan; ?></h1>
<h2><?php //echo $alamat_perusahaan; ?></h2>
  <div id="body">
      <?php
          //echo $bio;
          //echo $menu;
      ?>
      <div class="cleaner_h10"></div>
      <table align="center">
          <tr align="center">
              <td>
                  <?php
                      //echo $paginator;
                  ?>
              </td>
          </tr>
      </table>
      <div class="cleaner_h10"></div>
      <form method="post" name="frmSearch" action="<?php echo site_url('lappersediaancontroller');?>">
          <table width="60%" cellpadding="3" cellspacing="0" border="1">
              <tr>
                  <td width="90"><strong>Tanggal</strong></td>
                  <td><strong>:</strong></td>
                  <td><input type="text"  name="tglawal" id="tglawal" maxlength="10" value="" style="width:110px;"/></td>
                  <td><strong>S/D </strong></td>
                  <td><input type="text"  name="tglakhir" id="tglakhir" maxlength="10" value="" style="width:110px;"/></td>
              </tr>
              <tr>
                  <td width="75"><strong>Kode Barang</strong></td>
                  <td width="11"><strong>:</strong></td>
                  <td colspan="3"><input type="text"  name="kdbrgview" id="kdbrgview" size="50" />
                     <!-- <select name="kdbrng" >
                       		<option value="">-Select-</option>
                          <?php 
                              $count = count($masterbrg);
                              foreach($masterbrg as $comboInd)
                              {
                          ?>
                              <option value="<?php echo $comboInd->KodeDetailBarang?>"><?php echo $comboInd->Productname;?></option>
                          <?php }?>
                      </select>-->
                  </td>
              </tr>
              <tr valign="top">
                  <td></td>
                  <td colspan="5"><input type="submit" value="Search" name="btnview" ></td>
              </tr>
          </table>
      </form>
      <br />
      <div class="cleaner_h10"></div>
      <table border="1" cellpadding="3" cellspacing="0" width="80%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
          <tr style="background-color:#FFFFFF; color:#000000;" align="center">
              <td colspan="9" height="25"><strong>Laporan Stok Barang</strong></td>
          </tr>
          <tr style="background-color:#333; color:#FFFFFF;" align="center">
              <td>Kode Stock</td>
              <td>Tanggal Stock</td>
              <td>Nama Suplier</td>
              <td>Nama Barang</td>
              <td>Stock Akhir</td>
          </tr>
          <?php 
              if(count($dt_stock)>0)
              { 
          ?>
          {dt_stock}
          <tr class="cellDefault">
              <td><a href="<?php echo site_url('lappersediaandetailcontroller/detail');?>/{KodeStok}">{KodeStok}</a></td>
              <td>{CreatedOn}</td>
              <td>{Suppliername}</td>
              <td>{Productname}</td>
              <td>{StockAkhir}</td> 
          </tr>
          {/dt_stock}
          <?php 
              } 
              else
              {
                  echo "<tr>";
                  echo "<td colspan='9' style='text-align:center;color:red;'>No Data To Display</td>";
                  echo "</tr>";
              } 
          ?>
      </table>
      <form method="post" name="frmexcel" action="<?php echo site_url('lappersediaancontroller/toExcel');?>">
      <?php if(isset($tglAkhir) && isset($tglAwal)){?>
        <input type="hidden" name="tglAkhir" value="{tglAkhir}" />
      	<input type="hidden" name="tglAwal" value="{tglAwal}" />
      	<?php }?>
      <table border="1" cellpadding="3" cellspacing="0" width="80%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
          <tr align="center">
              <td>
                  <input type="submit" name="btntoxl" value="Export" />&nbsp;<input type="button" name="btnClose" value="Back" class="btn" onclick="javascript:window.location='<?php echo site_url('menuhomecontroller'); ?>';" />
              </td>
          </tr>
      </table>
      </form>
      <div class="cleaner_h10"></div>
      <table align="center">
          <tr align="center">
              <td>
                  <?php
                      //echo $paginator;
                  ?>
              </td>
          </tr>
      </table>
  </div>
